import { HeaderComponent } from './components/header/header.component';

import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { CommonModule, registerLocaleData } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NZ_I18N, zh_CN, } from 'ng-zorro-antd';
import { IconsProviderModule } from './icons-provider.module';
import { HttpClientModule } from '@angular/common/http';
import { NzMenuModule } from 'ng-zorro-antd/menu';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import zh from '@angular/common/locales/zh';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import { NzPaginationModule } from 'ng-zorro-antd/pagination';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions';
import { NzSwitchModule } from 'ng-zorro-antd/switch';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { NzListModule } from 'ng-zorro-antd/list';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { NzSpinModule } from 'ng-zorro-antd/spin';
import { NzAvatarModule } from 'ng-zorro-antd/avatar';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { NzTableModule } from 'ng-zorro-antd/table';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';
import { NzDividerModule  } from 'ng-zorro-antd/divider';
import {
  SideMenuComponent, StoreContainerComponent,
  VideoComponent, PdfViewerComponent, StatsCardComponent, ToolsContainerComponent,
  SearchToolsComponent, SearchresultComponent, TableDataComponent, TabsCardComponent,
  PagesCardComponent, SurveyCardComponent, FlexTableComponent, DetailModalComponent,
  LocationStoreComponent, WhiteLineTableComponent, ListResultPanelComponent, DrawToolsComponent,
  TitleContainerComponent, SmartTableComponent,
} from './components';
import { DragDirective } from './directive/drag.directive';
import { NzUploadModule } from 'ng-zorro-antd/upload';

import { NzEmptyModule } from 'ng-zorro-antd/empty';
import { NzCarouselModule } from 'ng-zorro-antd/carousel';
import { from } from 'rxjs';
const antZORRO =
  [
    NzPopconfirmModule,
    NzUploadModule,
    NzRadioModule,
    NzTableModule,
    NzTabsModule,
    NzAvatarModule,
    NzMenuModule,
    NzMessageModule,
    NzInputModule,
    NzTreeModule,
    NzLayoutModule,
    NzIconModule,
    IconsProviderModule,
    NzBreadCrumbModule,
    NzButtonModule,
    NzPaginationModule,
    NzModalModule,
    NzDescriptionsModule,
    NzSwitchModule,
    NzFormModule,
    NzDatePickerModule,
    NzSelectModule,
    NzCheckboxModule,
    NzListModule,
    NzInputNumberModule,
    NzSpinModule,
    NzTagModule,
    NzCollapseModule,
    NzEmptyModule,
    NzCarouselModule,
    NzDividerModule,
  ];

// ng 核心模块
const ngModules = [
  CommonModule,
  NzDropDownModule,
  HttpClientModule,
  FormsModule,
  ReactiveFormsModule,
  RouterModule
];

// 业务公共组件
const selfcomms = [
  TitleContainerComponent,
  ListResultPanelComponent,
  DrawToolsComponent,
  WhiteLineTableComponent,
  SideMenuComponent,
  HeaderComponent,
  PdfViewerComponent,
  StoreContainerComponent,
  StatsCardComponent,
  VideoComponent,
  SearchToolsComponent,
  SearchresultComponent,
  ToolsContainerComponent,
  TableDataComponent,
  TabsCardComponent,
  PagesCardComponent,
  FlexTableComponent,
  SurveyCardComponent,
  LocationStoreComponent,
  DetailModalComponent,
  SmartTableComponent,

];


registerLocaleData(zh);
@NgModule({
  imports: [
    PdfViewerModule,
    ...ngModules,
    ...antZORRO,
  ],
  declarations: [
    ...selfcomms,
    DragDirective
  ],
  exports: [
    ...ngModules,
    ...selfcomms,
    ...antZORRO,
    DragDirective
  ],
  providers: [
    { provide: NZ_I18N, useValue: zh_CN }
  ]
})
export class SharedModule { }
